.page {
  --gray-rgb: 0, 0, 0;
  --gray-alpha-200: rgba(var(--gray-rgb), 0.08);
  --gray-alpha-100: rgba(var(--gray-rgb), 0.05);
  --primary-color: #007bff;
  --primary-hover: #0056b3;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --background-color: #f8f9fa;
  --background-light: #ffffff;
  --background-secondary: #f8f9fa;
  --text-primary: #333333;
  --text-secondary: #666666;
  --border-color: #e1e5e9;

  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-synthesis: none;
  background-color: var(--background-color);
}

@media (prefers-color-scheme: dark) {
  .page {
    --gray-rgb: 255, 255, 255;
    --gray-alpha-200: rgba(var(--gray-rgb), 0.145);
    --gray-alpha-100: rgba(var(--gray-rgb), 0.06);
    --background-color: #1a1a1a;
  }
}

/* Banner 样式 */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 60px 80px;
  background: linear-gradient(135deg, var(--primary-color), #0056b3);
  color: white;
  min-height: 400px;
}

.bannerContent {
  flex: 1;
  max-width: 500px;
}

.bannerContent h1 {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 1rem;
  font-family: var(--font-geist-sans);
}

.bannerContent p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.ctaButton {
  background-color: white !important;
  color: var(--primary-color) !important;
  font-weight: bold;
  padding: 12px 24px !important;
  border-radius: 8px !important;
  font-size: 1.1rem !important;
}

.bannerImage {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.bannerImage img {
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* 推荐内容样式 */
.recommended {
  padding: 60px 80px;
  background: white;
}

.recommended h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: #333;
  font-family: var(--font-geist-sans);
}

.recommendedGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.recommendedCard {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
}

.recommendedCard:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.productImage {
  margin-bottom: 1rem;
}

.productImage img {
  border-radius: 8px;
  width: 100%;
  height: auto;
}

.recommendedCard h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: #333;
}

.recommendedCard p {
  color: #666;
  margin-bottom: 1rem;
}

.price {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* 商品列表样式 */
.productList {
  padding: 60px 80px;
  background: var(--background-color);
}

.productList h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: #333;
  font-family: var(--font-geist-sans);
}

.listHeader {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 1rem;
  padding: 1rem 2rem;
  background: white;
  border-radius: 8px 8px 0 0;
  font-weight: bold;
  color: #333;
  border-bottom: 2px solid var(--primary-color);
}

.listContent {
  background: white;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.listItem {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 1rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid #eee;
  align-items: center;
  transition: background-color 0.2s ease;
}

.listItem:hover {
  background-color: #f8f9fa;
}

.listItem:last-child {
  border-bottom: none;
}

/* 导航链接样式 */
.navigation {
  padding: 40px 80px;
  background: white;
  text-align: center;
}

.navigation h3 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: #333;
}

.navLinks {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.navLink {
  display: inline-block;
  padding: 12px 24px;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.navLink:hover {
  background: #0056b3;
  text-decoration: none;
}

/* Footer 样式 */
.footer {
  padding: 2rem 80px;
  background: #333;
  color: white;
  text-align: center;
  font-family: var(--font-geist-sans);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .banner {
    flex-direction: column;
    padding: 40px 20px;
    text-align: center;
  }

  .bannerContent h1 {
    font-size: 2rem;
  }

  .bannerContent p {
    font-size: 1rem;
  }

  .recommended,
  .productList,
  .navigation {
    padding: 40px 20px;
  }

  .recommendedGrid {
    grid-template-columns: 1fr;
  }

  .listHeader,
  .listItem {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    text-align: center;
  }

  .navLinks {
    flex-direction: column;
    align-items: center;
  }

  .footer {
    padding: 2rem 20px;
  }
}

@media (prefers-color-scheme: dark) {
  .recommended,
  .navigation {
    background: #2a2a2a;
  }

  .recommended h2,
  .productList h2,
  .navigation h3 {
    color: white;
  }

  .recommendedCard {
    background: #333;
    color: white;
  }

  .recommendedCard h3 {
    color: white;
  }

  .recommendedCard p {
    color: #ccc;
  }

  .listHeader,
  .listContent {
    background: #333;
    color: white;
  }

  .listItem {
    border-bottom-color: #555;
  }

  .listItem:hover {
    background-color: #444;
  }
}

/* ProductList 组件样式 */
.productListContainer {
  width: 100%;
}

.personalizationInfo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--background-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.userInfo {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.userId {
  font-weight: 600;
  color: var(--text-primary);
}

.interests {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.refreshButton {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.refreshButton:hover {
  background: var(--primary-hover);
}

.productGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.productCard {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border-color);
}

.productCard:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.productImage {
  height: 200px;
  background: var(--background-light);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
}

.imagePlaceholder {
  font-size: 3rem;
  color: var(--text-secondary);
}

.productInfo {
  padding: 1rem;
}

.productInfo h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.category {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  background: var(--background-light);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

.priceInfo {
  margin-bottom: 0.5rem;
}

.price {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-color);
}

.productMeta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.rating {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.sales {
  display: flex;
  align-items: center;
}

.productActions {
  display: flex;
  gap: 0.5rem;
}

.viewButton {
  flex: 1;
  background: var(--background-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.viewButton:hover {
  background: var(--border-color);
}

.buyButton {
  flex: 1;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.buyButton:hover {
  background: var(--primary-hover);
}

.loadMoreSection {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.loadMoreButton {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.loadMoreButton:hover:not(:disabled) {
  background: var(--primary-hover);
}

.loadMoreButton:disabled {
  background: var(--text-secondary);
  cursor: not-allowed;
}

.loadingIndicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
  padding: 2rem;
  background: var(--background-light);
  border-radius: 8px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loadingIndicator p {
  color: var(--text-secondary);
  margin: 0;
}

.noMoreData {
  text-align: center;
  margin: 2rem 0;
  padding: 1rem;
  background: var(--background-light);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.noMoreData p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 1rem;
}

/* 管理页面样式 */
.controlGroup {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.controlGroup label {
  font-weight: 600;
  color: var(--text-primary);
}

.select {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  background: white;
}

.actionButton {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: background-color 0.2s;
  margin-top: 1rem;
}

.actionButton:hover:not(:disabled) {
  background: var(--primary-hover);
}

.actionButton:disabled {
  background: var(--text-secondary);
  cursor: not-allowed;
}

.resultBox {
  background: var(--background-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.resultJson {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.instructions {
  background: var(--background-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.instructions h3 {
  color: var(--text-primary);
  margin: 1.5rem 0 0.5rem 0;
  font-size: 1.1rem;
}

.instructions h3:first-child {
  margin-top: 0;
}

.instructions p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.instructions ol,
.instructions ul {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.instructions li {
  margin-bottom: 0.5rem;
}

.instructions code {
  background: #f1f3f4;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--primary-color);
}

/* 管理页面用户信息样式 */
.userInfo {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0.5rem;
  background: var(--background-light);
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.userInfo span {
  color: var(--text-secondary);
}

/* 错误页面样式 */
.errorBox {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.errorBox h2 {
  color: #c53030;
  margin-bottom: 1rem;
}

.errorBox p {
  color: #e53e3e;
  margin-bottom: 1.5rem;
}

.errorDetails {
  text-align: left;
  margin: 1.5rem 0;
}

.errorDetails h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.errorDetails ul {
  color: var(--text-secondary);
  padding-left: 1.5rem;
}

.errorDetails li {
  margin-bottom: 0.5rem;
}
